home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / MODEMPRO / HOST110.ZIP;1 / HOSTCFG.SCR < prev    next >
Encoding:
Text File  |  1994-05-07  |  4.0 KB  |  98 lines

  1. ' Configuration routines for host mode.
  2. '
  3. ' DO NOT COMPILE THIS FILE BY ITSELF!
  4. '
  5. ' This file is a part of the complete HOST.SCR and will not compile
  6. ' alone.  To recompile the host scripts, select Scripts/Compile from
  7. ' the QmodemPro for Windows menu and select HOST.SCR in the "Compile
  8. ' script" dialog box.  This file will automatically be compiled as
  9. ' part of the full script.
  10.  
  11. declare sub GetPrivateProfileString lib "kernel" (section as string, entry as string, default as string, buffer as string, bufsize as integer, filename as string)
  12. declare function GetPrivateProfileInt lib "kernel" (section as string, entry as string, default as integer, filename as string) as integer
  13. declare sub WritePrivateProfileString lib "kernel" (section as string, entry as string, data as string, filename as string)
  14.  
  15. function GetHostProfileString(entry as string, default as string) as string
  16.   dim buf as string
  17.   buf = space(128)
  18.   call GetPrivateProfileString("Host", entry, default, buf, 128, "qmwin.ini")
  19.   GetHostProfileString = buf
  20. end function
  21.  
  22. function GetHostProfileInt(entry as string, default as integer) as integer
  23.   GetHostProfileInt = GetPrivateProfileInt("Host", entry, default, "qmwin.ini")
  24. end function
  25.  
  26. sub WriteHostProfileString(entry as string, data as string)
  27.   call WritePrivateProfileString("Host", entry, data, "qmwin.ini")
  28. end sub
  29.  
  30. sub WriteHostProfileInt(entry as string, data as integer)
  31.   call WriteHostProfileString(entry, str(data))
  32. end sub
  33.  
  34. function SetupDialog.id(200) as integer
  35.   dim d as ModemSetupDialog
  36.   d = ModemSetup
  37.   if dialogbox(d) = IDOK then
  38.     ModemSetup = d
  39.     call WriteHostProfileString("ModemInit", ModemSetup.init)
  40.     call WriteHostProfileString("ModemAnswer", ModemSetup.answer)
  41.     call WriteHostProfileString("ModemBusy", ModemSetup.busy)
  42.     call WriteHostProfileString("ModemOK", ModemSetup.ok)
  43.     call WriteHostProfileString("ModemRing", ModemSetup.ring)
  44.     call WriteHostProfileString("ModemRingCount", ModemSetup.ringcount)
  45.     call WriteHostProfileInt("ModemFaxAnswer", ModemSetup.faxanswer)
  46.     call WriteHostProfileInt("ModemFaxAto", ModemSetup.faxato)
  47.   end if
  48. end function
  49.  
  50. sub SetupHost
  51.   dim d as SetupDialog
  52.   d = Setup
  53.   if dialogbox(d) = IDOK then
  54.     Setup = d
  55.     if Setup.modeopen then
  56.       call WriteHostProfileInt("Mode", 0)
  57.     elseif Setup.modeclosed then
  58.       call WriteHostProfileInt("Mode", 1)
  59.     elseif Setup.modecallback then
  60.       call WriteHostProfileInt("Mode", 2)
  61.     end if
  62.     call WriteHostProfileString("MaxTime", Setup.maxtime)
  63.     call WriteHostProfileString("DosPassword", Setup.dospass)
  64.     call WriteHostProfileString("ShutdownPassword", Setup.shutdownpass)
  65.     call WriteHostProfileString("DownloadPath", Setup.dlpath)
  66.     call WriteHostProfileString("UploadPath", Setup.ulpath)
  67.     call WriteHostProfileInt("SysopAnyPath", Setup.sysopanypath)
  68.   end if
  69. end sub
  70.  
  71. sub LoadConfig
  72.   Setup.modeopen = 0
  73.   Setup.modeclosed = 0
  74.   Setup.modecallback = 0
  75.   select case GetHostProfileInt("Mode", 0)
  76.     case 0
  77.       Setup.modeopen = 1
  78.     case 1
  79.       Setup.modeclosed = 1
  80.     case 2
  81.       Setup.modecallback = 1
  82.   end select
  83.   Setup.maxtime = str(GetHostProfileInt("MaxTime", 60))
  84.   Setup.dospass = GetHostProfileString("DosPassword", "")
  85.   Setup.shutdownpass = GetHostProfileString("ShutdownPassword", "")
  86.   Setup.dlpath = GetHostProfileString("DownloadPath", "")
  87.   Setup.ulpath = GetHostProfileString("UploadPath", "")
  88.   Setup.sysopanypath = GetHostProfileInt("SysopAnyPath", 0)
  89.   ModemSetup.init = GetHostProfileString("ModemInit", "ATQ0H0S0=0^M")
  90.   ModemSetup.answer = GetHostProfileString("ModemAnswer", "ATA^M")
  91.   ModemSetup.busy = GetHostProfileString("ModemBusy", "ATH1M0^M")
  92.   ModemSetup.ok = GetHostProfileString("ModemOK", "OK")
  93.   ModemSetup.ring = GetHostProfileString("ModemRing", "RING")
  94.   ModemSetup.ringcount = str(GetHostProfileInt("ModemRingCount", 1))
  95.   ModemSetup.faxanswer = GetHostProfileInt("ModemFaxAnswer", 0)
  96.   ModemSetup.faxato = GetHostProfileInt("ModemFaxAto", 0)
  97. end sub
  98.